Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of metadata-based freshness #1072

Merged
merged 7 commits into from
Jan 18, 2024

Conversation

mikealfare
Copy link
Contributor

@mikealfare mikealfare commented Jan 17, 2024

resolves #938

Problem

The current implementation of source freshness requires querying the data and requires the user provide a datetime field. This is slower and more expensive than it should be. It doesn't scale across multiple models. And some models do not have an appropriate datetime field.

Solution

Use source metadata where available.

NOTE: We are releasing to 1.7.latest first, which is unusual. This PR is a set of cherry picks from #1060. The latter will be updated and merged post adapter/core split work.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@mikealfare mikealfare self-assigned this Jan 17, 2024
@mikealfare mikealfare requested a review from a team as a code owner January 17, 2024 23:52
@cla-bot cla-bot bot added the cla:yes label Jan 17, 2024
@mikealfare mikealfare linked an issue Jan 17, 2024 that may be closed by this pull request
@@ -0,0 +1,18 @@
import pytest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be in the functional directory?

dataset_ref = DatasetReference(project.database, project.test_schema)
table_ref = TableReference(dataset_ref, table_name)
with pytest.raises(NotFound):
client.get_table(table_ref)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to test the bigquery api?

@mikealfare mikealfare merged commit 24748d2 into 1.7.latest Jan 18, 2024
26 checks passed
@mikealfare mikealfare deleted the source-freshness/metadata-based-1.7.latest branch January 18, 2024 22:08
elyobo added a commit to elyobo/docs.getdbt.com that referenced this pull request Jan 22, 2024
@elyobo
Copy link

elyobo commented Jan 22, 2024

Thanks @mikealfare, I've added an update to the docs at dbt-labs/docs.getdbt.com#4784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ADAP-912] Support Metadata Freshness
4 participants